﻿#region
using System;
using Google.GData.Extensions;
using Google.GData.Extensions.MediaRss;
using Google.YouTube;
using YoutubeExtractor;

#endregion

namespace Y2M2
{
    public class Clip
    {
        public Clip(Video video)
        {
            _video = video;
            ThumbnailUrl = video.Thumbnails.Count > 0 ? video.Thumbnails[0].Url : string.Empty;
        }

        private readonly Video _video;
        public VideoInfo VideoInfo { get; internal set; }

        public string Id
        {
            get { return _video.VideoId; }
        }

        public string Title
        {
            get { return _video.Title; }
        }

        public Uri WatchPage
        {
            get { return _video.WatchPage; }
        }

        public string VideoExtension
        {
            get { return VideoInfo.VideoExtension; }
        }

        public string DownloadUrl { get; set; }

        public string ThumbnailUrl { get; private set; }

        public byte[] Thumbnail { get; set; }
    }
}